
#ifndef __SYSTASK_H
#define	__SYSTASK_H

#include <stdint.h>
#include "dataproc.h"
#include "pulse.h"
#include "rtctime.h"
#include "mytype.h"
#include "iohandle.h"

#ifdef	__cplusplus
extern "C" {
#endif

#ifdef   _SYSTASK_MODULE_
#define  MY_EXT
#else
#define  MY_EXT  extern
#endif  

  typedef struct
  {
    uint32_t st;
  } sys_info_type;

  typedef struct
  {
    volatile uint32_t u_tick;
    volatile uint32_t powerup_time_cnt;
    volatile uint32_t clks_at_event_rcv;

    timer_pulse_type pulse;
    sig_time_type sig_time;
    TIME_Type rtc_time;
    led_breath_type led_obj;
    volatile uint8_t b_coremark;
    uint32_t exe_time_us;
    uint32_t exe_time_us_max;

    volatile uint8_t lx_clr_req;
    volatile uint8_t lx_tst_req;

    struct
    {
      uint32_t addr;
      uint32_t data;
      uint32_t erase_time;
      uint32_t program_time;
      uint32_t read_time;
    }spim;

    struct
    {
      uu32 SYS;
      uu32 AHB;
      uu32 APB1;
      uu32 APB2;
    } clk;

  } sys_run_st_type;

  MY_EXT sys_run_st_type sys_st;

#undef MY_EXT

#ifdef	__cplusplus
}
#endif

#endif	/* __SYSTASK_H */
